<?php
/**
将文件列表数组输出成有排序索引的行
**/
// 路由文件
$arr_file = array(
    "extension.php",
    "index.php",
);



$i = 0;
// index 应用
foreach ($arr_file as $key => &$value) {
    $value = preg_replace('/\.php$/i', '', $value);
    $value = "$i => 'index/$value'";
    $i++;
}
echo $str_file = implode(',' . PHP_EOL, $arr_file) . ',';
echo PHP_EOL;

$arr_file = array(
"Basic HTTP.php",
"Digest HTTP.php",
"auth.php",
"login.php",
"remote.php",
"session.php",
"test.php",
"wonder.php",
);

// .php 文件夹
$arr_file0 = array(
"logon",
"realm",
);

# $i = 0;
// http_auth 应用
foreach ($arr_file as $key => &$value) {
    $value = preg_replace('/\.php$/i', '', $value);
    $value = "$i => 'http_auth/$value'";
    $i++;
}
echo $str_file = implode(',' . PHP_EOL, $arr_file) . ',';
echo PHP_EOL;

// 路由配置
$arr_idx = array(
    '' => '.',
    '.' => 'index/index',
0 => 'index/extension',
1 => 'index/index',
2 => 'http_auth/Basic HTTP',
3 => 'http_auth/Digest HTTP',
4 => 'http_auth/auth',
5 => 'http_auth/login',
6 => 'http_auth/remote',
7 => 'http_auth/session',
8 => 'http_auth/test',
9 => 'http_auth/wonder',




);


// .php 目录配置
$arr_idx0 = array(
    0 => 'http_auth/logon',
1 => 'http_auth/realm',

);

print_r($arr_idx);
